package com.yl.auth.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yl.auth.model.entity.Chenlian;
import com.yl.auth.model.vo.ChenlianVo;
import com.yl.auth.service.ChenlianService;
import com.yl.common.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/admin/xiaochengxuchenlian")
@Api(tags = "小程序-老人晨练")
public class Xiaochengxuchenlian {
    @Resource
    private ChenlianService chenlianService;

    @GetMapping("/getxiaochenlian")
    @ApiOperation(value = "获取全部老人晨练信息")
    public Result getxiaochenlian(){
        List<ChenlianVo> chenlianVoList = chenlianService.getxiaochenlian();
        return Result.ok(chenlianVoList);
    }

    @PostMapping("/addchenlian")
    @ApiOperation(value = "添加晨练")
    public Result addchenlian(Chenlian chenlian){
        chenlianService.save(chenlian);
        return Result.ok();
    }
}
